package com.spvs.job.domain;

import lombok.Getter;

import java.util.Arrays;

/**
 * 周期
 */
@Getter
public enum UpkeepEnum {
    DAY_PLAN("1","日计划"),

    WEEK_PLAN("7","周计划"),

    MONTH_PLAN("30","月计划"),

    SEASON_PLAN("90","季计划"),

    YEAR_PLAN("360","年计划");


    UpkeepEnum(String code, String desc){
        this.code = code;
        this.desc = desc;
    }
    private String code;
    private String desc;

    public static UpkeepEnum getByFormCode(String desc){
        return Arrays.stream(UpkeepEnum.values())
                .filter(value -> value.getDesc().equals(desc))
                .findFirst().orElse(null);
    }
}
